package cn.dapeng.kafka.message;

import cn.dapeng.kafka.config.KafkaTemplate;
import cn.dapeng.rocket.message.MessageOperate;

/**
 * @BelongProject message-queue
 * @BelongPackage cn.dapeng.kafka.message
 * @Description TODO
 * @ClassName KafkaMessageOperate
 * @Author xupenghong
 * @Date 2024/6/27 15:13
 * @Version 1.0.0
 */
public class KafkaMessageOperate implements MessageOperate {
    private final KafkaTemplate kafkaTemplate;

    public KafkaMessageOperate(KafkaTemplate kafkaTemplate) {
        this.kafkaTemplate = kafkaTemplate;
    }

    @Override
    public void sendMessage(String message) {
        kafkaTemplate.print();
        System.out.println("kafka发送消息：" + message);
    }

}
